package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.dto.UserDto;
import com.zzyl.entity.User;
import com.zzyl.vo.UserVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

@Mapper
public interface SysUserMapper {

    int deleteByPrimaryKey(Long id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    /**
     * 这是Mybatis Generator拓展插件生成的方法(请勿删除).
     * This method corresponds to the database table sys_user
     *
     * @mbg.generated
     * @author hewei
     */
    int batchInsert(@Param("list") List<User> list);


    Page<UserVo> getUserByPage(UserDto userDto);

    Set<UserVo> getUserList(String realName);

    Set<String> findRoleIdsByUserId(Long id);

    Set<String> findRoleLabelsByUserId(Long id);

    void updateUserState(@Param("id") Long id, @Param("status") Integer status);

    void deleteUser(@Param("userIds") Long[] userIds);

    void resetPasswords(@Param("userId") Long userId, @Param("password") String password);


    Integer selectParentDeptNo(String deptNo);

    User selectByUsername(String username);
}